package com.wen.open.springframework.test.context;

import com.wen.open.springframework.beans.BeansException;
import com.wen.open.springframework.beans.factory.BeanClassLoaderAware;
import com.wen.open.springframework.beans.factory.BeanFactory;
import com.wen.open.springframework.beans.factory.BeanFactoryAware;
import com.wen.open.springframework.beans.factory.BeanNameAware;
import com.wen.open.springframework.context.ApplicationContext;
import com.wen.open.springframework.context.ApplicationContextAware;

/**
 * @author Wen
 * @date 2023/4/25 10:47
 */
public class MyAware implements BeanNameAware, BeanFactoryAware, BeanClassLoaderAware, ApplicationContextAware {
    private ClassLoader classLoader;
    private BeanFactory beanFactory;
    private String beanName;
    private ApplicationContext applicationContext;

    @Override
    public void setBeanClassLoader(ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        this.beanFactory = beanFactory;
    }

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    public void debug() {
        System.out.println("debug");
    }

}
